/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "向量.h"
#include "引擎数据类型.h"



typedef struct {
	vec3* m_cu位置;
	vec3* m_cu前一帧位置;
	vec3* m_cu速度;
	vec3* m_cu加速度;
	vec3* m_cu移动变化量;
	vec3* m_cu外力;


	vec3* m_cu刚体初始位置;
	//vec3* m_cu刚体初始质心;
	//mat3X3* m_cu刚体初始矩阵;
	uint32* m_cu刚体起始索引;
	uint16* m_cu刚体粒子数量;

	
	float32* m_cu质量;
	float32* m_cu密度;
	float32* m_cu拉格朗日;
	float32* m_cu平方范数;
	uint32* m_cu物理体ID;
	uint8*	m_cu物理体类型;


	float32	m_粒光滑子半径;
	float32	m_密度0;
	float32	m_Weight0;
	float32	m_K;
	float32	m_L;
	

	uint16	m_线程块大小;
} S_PBF_Gpu ;





typedef struct {
	uint32* m_Indexs;
	uint32* m_VoxelIndexs;
	uint8* m_IndexNum;

	float32 m_粒子半径;
	float32 m_粒子光滑半径;
	float32 m_K;
	float32 m_L;
	float32 m_Poly6;
	float32 m_Spiky;
	float32 m_Viscosity;

}S_cuAdjacencyIndex;





typedef struct {
	vec3*	m_位置;
	uint32* m_物理体ID;
	uint8*	m_物理体类型;
}S_CP_parameter;










typedef struct {
	uint32	m_Offset;
	uint32	m_Count;
	float32	m_密度;

	S_体素* m_体素;

	mat3X3	m_旋转矩阵;
	vec3	m_中心坐标;
}S_PBF刚体;





typedef struct {
	S_体素* m_体素;

	uint32	m_Offset;
	uint32	m_Count;
	//uvec2	m_区间;
	uint32	m_偏移;
	uint32	m_数量;

	bool	m_以发射完;

}S_PBF粒子发射;



